{include file="public_head" /}
<!-- upload -->
<link href="__STATIC__/css/uploads.css" rel="stylesheet">
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">


<body class="nav-md">

<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <!--<div class="title_left">-->
                    <!--<h3>广告位管理</h3>-->
                    <!--</div>-->
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>创建礼包订单
                                    <!--<small>different form elements</small>-->
                                </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <br/>
                                <form class="form-horizontal form-label-left" enctype="multipart/form-data" action="{:url('create_gift')}?abc=43" method="get" id="registerForm">

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">用户名称：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12" >
                                            <input style="width: 70%" type="text" placeholder="请填写用户名" datatype="s11-11"
                                                   class="form-control col-md-7 col-xs-12" name="username"
                                                   value="" datatype="*" nullmsg="请填写用户名"  errormsg="用户名请添11位手机号"
                                            ><a style="float: right"  class="btn btn-primary" id="parentIframe">查询</a>
                                        </div>
                                    </div>
                                    <!--<div class="form-group">-->
                                    <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">商品分类：</label>-->
                                    <!--<div class="col-md-6 col-sm-6 col-xs-12">-->
                                        <!--<select name="parenTid" class="select2_single"-->
                                                <!--style="width: 500px;" tabindex="-1"-->
                                                <!--datatype="*"-->
                                                <!--nullmsg="请选择规则栏目！" errormsg="请选择规则栏目！"-->
                                        <!--&gt;-->
                                            <!--<option-->
                                                    <!--value="0"-->
                                                    <!--{eq name='item.parenTid|default=""' value='0'}selected{/eq}-->
                                            <!--&gt;-->
                                            <!--一级栏目-->
                                            <!--</option>-->
                                            <!--{volist name="goods_type" id="list"}-->
                                            <!--<option-->

                                            <!--{in name='list.count' value='1,2'}disabled{/in}-->

                                            <!--value="{$list.id}"-->

                                            <!--&gt;-->
                                            <!--{neq name="list.parenTid" value="0"}-->
                                            <!--{:str_repeat('　',$list['count'])}-->
                                            <!--{/neq}-->
                                            <!--{eq name="item.parenTid|default=''" value="0"}-->
                                            <!--<span>&nbsp;</span>-->
                                            <!--{else /}-->
                                            <!--<span>&nbsp;</span>-->
                                            <!--{/eq}-->
                                            <!--{neq name="list.count" value="1"}|&nbsp;&#45;&#45;&nbsp;{/neq}-->
                                            <!--{$list.title}-->
                                            <!--</option>-->
                                            <!--{/volist}-->
                                        <!--</select>-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">礼包列表：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <select name="gift_id" class="select2_single"
                                                    style="width: 500px;" tabindex="-1"
                                                    datatype="*"
                                                    nullmsg="请选择栏目分类！" errormsg="请选择栏目分类！"
                                            >
                                                {volist name="gift_list" id="item"}
                                                <option value="{$item.id}"
                                                >
                                                {$item.title}
                                                </option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">服务门店：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12">
                                            {if condition="$auding_status eq 2"}
                                            <select name="shop_id" class="form-control" style="width: 300px;float: left;" tabindex="-1">
                                            <!--<option value="0">请选择门店</option>-->
                                            {foreach :model('shop')->where('auding_status',2)->order('shop_status','asc')->select() as $key=>$vo }
                                            <option value="{$vo.id}" {eq name='$item.shop_id|default=""' value='$vo.id' }selected{/eq}>{switch name="$vo.shop_status"}
                                            {case 1}空闲{/case}
                                            {case 2}{$vo.wait_time_index}-{$vo.wait_time_h}时{$vo.wait_time_m}分{/case}
                                            {/switch}-{$vo.shop_title}</option>
                                            {/foreach}
                                            </select>
                                            {else/}
                                            <select name="shop_id" class="form-control" style="width: 300px;float: left;" tabindex="-1" >
                                            <option value="{:session('shop_id')}">{:model('shop')->where('id',session('shop_id'))->value('shop_title')}</option>

                                            </select>

                                            {/if}
                                        </div>
                                    </div>
                                    {in name=":session('manage_id')" value="$manage_array"}
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" style="text-align: right">是否免费：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <label class="radio_box">
                                                <input type="radio" name="order_is_free" id="status_1" class="cartradio"
                                                       value="1"
                                                       datatype="*"
                                                       nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"

                                                >&nbsp;&nbsp;
                                                <label for="status_1"></label>
                                                <span>是</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="order_is_free" id="status_2" class="cartradio"
                                                       value="2"
                                                       datatype="*"
                                                       nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                       checked

                                                >&nbsp;&nbsp;
                                                <label for="status_2"></label>
                                                <span>否</span>
                                                &nbsp;&nbsp;
                                            </label>
                                        </div>
                                    </div>
                                    {else/}
                                    <input type="hidden" name="order_is_free" value="2">
                                    {/in}
                                    <!--<div class="form-group">-->
                                        <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">服务门店：</label>-->
                                        <!--<div class="col-md-2 col-sm-6 col-xs-12">-->
                                            <!--<input name="username" value="" placeholder="请填写用户名" />-->
                                        <!--</div>-->
                                    <!--</div>-->


                                    <div class="form-group">
                                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                            <button type="submit" class="btn btn-primary">提交</button>
                                            <a type="reset" class="btn btn-success" onclick="history.go(-1)">返回</a>
                                        </div>
                                    </div>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
            <!-- /page content -->

        </div>

    </div>
</div>

{include file="public_foot" /}

<!-- Datatables-->
<script src="__STATIC__/js/datatables/jquery.dataTables.min.js"></script>
<script src="__STATIC__/js/datatables/dataTables.bootstrap.js"></script>
<!-- validform -->
<script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<!--select-->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<!--upload-->
<script type="text/javascript" src="__STATIC__/js/uploadPreview.js"></script>

<!-- ueditor -->
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>
<style>
    .layui-layer-ico {
        background: url(/default/icon.png) no-repeat;
    }
</style>
<script>
    $('#parentIframe').click(function(){
        var title = $('[name="username"]').val();
        if(!title){
            layer.msg('用户名或车牌号不能为空');
            return;
        }
        layer.open({
            type: 2,
            area: ['700px', '450px'],
            fixed: false, //不固定
            maxmin: true,
            content: 'http://lihai.xmdonkey.com/index.php/console/member/title?title='+title
        });
    });
    //upload
    window.onload = function () {
        new uploadPreview({UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow"});
    }
    $(".select2_single").select2({
        placeholder: "请选择分类",
        allowClear: true
    });

    // 实例化编辑器
    var ue = UE.getEditor('containers');
    //validform
    $(function () {

        $.Tipmsg.r = null;

        var showmsg = function (msg) {
            //假定你的信息提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
            alert(msg);
        }
        $("#registerForm").Validform({
            tiptype: function (msg) {
                layer.msg(msg);
            },
            tipSweep: true
        });


        // select2


        $(".select2_multiple").select2({
            maximumSelectionLength: 0,
            placeholder: "请选择关联品牌",
            allowClear: true
        });

    })


</script>
</body>

</html>
